import React from 'react'
import "./Goods.less"
import { Link } from "react-router-dom"
export default function Goods(props) {
    return (
        <div className="goods">
            {
                props.list.map((item) => {
                    //跳转到详情页，使用动态路由传参
                    <Link to={"/detail" + item.id} className="item" key={item.id}>
                        <img src={item.img} alt="" />
                        {item.goodsname}
                    </Link>
                })
            }
        </div>
    )
}